package com.zhang.service.impl;

import com.zhang.entity.Salt;
import com.zhang.repository.SaltRepository;
import com.zhang.service.SaltService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 21级 计科院·张艺澄
 * 2024.12.8
 */
@Service("saltService")
public class SaltServiceImpl implements SaltService {

    @Resource
    private SaltRepository saltRepository;

    @Override
    public Salt findByUserName(String salt) {
        return saltRepository.findByUserName(salt);
    }

    @Override
    public Salt findById(Integer saltId) {
        return saltRepository.findById(saltId).get();
    }

    @Override
    public void save(Salt salt) {
        saltRepository.save(salt);
    }


    @Override
    public void delete(Integer id) {
        saltRepository.deleteById(id);
    }
}
